'use strict';

module.exports = app => {
    const mongoose = app.mongoose
    const Schema = mongoose.Schema
    const UserSchema = new Schema({

        username: {},
        password: {},
        token: {},
        info: {
            nick: {},
            avator: {},
            status: {},
            lastLoginIp: {},
            lastLoginTime: {},
            creatorId: {},
            createTime: {},
            deleted: {},
            menuList: [],
            role: {
                id: {},
                username: {},
                status: {},
                actionList: {},
                deleted: {},
                permissions: [],
            }
        },
        //菜单
        name: {},
        parentId: {},
        id: {},
        meta: {
            icon: {},
            title: {},
            show: {},
        },
        component: {},
        redirect: {},
    },{
        timestamps: true
    })
    return mongoose.model('users',UserSchema)
};
